package com.epower.tools.bean;

import org.apache.log4j.Logger;

/**
 * @description: ${描述}
 * @author: LIU JUN
 * @create: 2021-03-21 15:52
 */

public class StatusChannelInfo {
    static Logger logger = Logger.getLogger(StatusChannelInfo.class);
    private String dn;
    private String chId;
    private String ph;
    private String ccbm;
    private String y;

    public static StatusChannelInfo newInstance(String text) throws Exception {
        return new StatusChannelInfo(text);
    }

    public StatusChannelInfo(String text) {
        if (text == null) {
            return;
        }
        //An,ch_id,ph,ccbm,uu,a,b,skew,min,max,primary,secondary,PS

        String[] arr = text.split(",");
        if (arr.length != 5) {
            logger.debug("解析行失败，内容:" + text + " 不符合 Dn,ch_id,ph,ccbm,y");
        }
        this.dn = arr[0];
        this.chId = arr[1];
        this.ph = arr[2];
        this.ccbm = arr[3];
        this.y = arr[4];
    }


    public String getDn() {
        return dn;
    }

    public void setDn(String dn) {
        this.dn = dn;
    }

    public String getChId() {
        return chId;
    }

    public void setChId(String chId) {
        this.chId = chId;
    }

    public String getPh() {
        return ph;
    }

    public void setPh(String ph) {
        this.ph = ph;
    }

    public String getCcbm() {
        return ccbm;
    }

    public void setCcbm(String ccbm) {
        this.ccbm = ccbm;
    }

    public String getY() {
        return y;
    }

    public void setY(String y) {
        this.y = y;
    }

    @Override
    public String toString() {
        return "StatusChannelInfo{" +
                "dn='" + dn + '\'' +
                ", chId='" + chId + '\'' +
                ", ph='" + ph + '\'' +
                ", ccbm='" + ccbm + '\'' +
                ", y='" + y + '\'' +
                '}';
    }
}
